@ibiz-template-plugin/ibiz-file-previewer 0.0.18 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +14 -13
- package/dist/index.legacy.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1753,16 +1753,10 @@ const Teleport = ({ to = "body", children }) => {
|
|
|
1753
1753
|
const target = document.querySelector(to);
|
|
1754
1754
|
if (target) {
|
|
1755
1755
|
containerRef.current = target;
|
|
1756
|
-
} else {
|
|
1757
|
-
const el = document.createElement("div");
|
|
1758
|
-
el.id = to.replace("#", "");
|
|
1759
|
-
document.body.appendChild(el);
|
|
1760
|
-
containerRef.current = el;
|
|
1761
1756
|
}
|
|
1762
1757
|
return () => {
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
(_a = containerRef.current) == null ? void 0 : _a.remove();
|
|
1758
|
+
if (containerRef.current) {
|
|
1759
|
+
containerRef.current = null;
|
|
1766
1760
|
}
|
|
1767
1761
|
};
|
|
1768
1762
|
}, [to]);
|
|
@@ -18472,8 +18466,9 @@ const ThumbnailPanel = (props) => {
|
|
|
18472
18466
|
const ImagePage = (props) => {
|
|
18473
18467
|
const isLoading = useSignal(true);
|
|
18474
18468
|
const imgRef = A(null);
|
|
18469
|
+
const [imgStyle, setImgStyle] = d$2({});
|
|
18475
18470
|
const elementHeight = useSignal(0);
|
|
18476
|
-
|
|
18471
|
+
y$1(() => {
|
|
18477
18472
|
let result = {};
|
|
18478
18473
|
const { width, height } = props.parentDimensions;
|
|
18479
18474
|
if (isLoading.value) {
|
|
@@ -18500,8 +18495,8 @@ const ImagePage = (props) => {
|
|
|
18500
18495
|
});
|
|
18501
18496
|
}
|
|
18502
18497
|
}
|
|
18503
|
-
|
|
18504
|
-
});
|
|
18498
|
+
setImgStyle(result);
|
|
18499
|
+
}, [props.parentDimensions, props.state.value, isLoading.value]);
|
|
18505
18500
|
const handleImageLoad = () => {
|
|
18506
18501
|
isLoading.value = false;
|
|
18507
18502
|
};
|
|
@@ -18533,7 +18528,7 @@ const ImagePage = (props) => {
|
|
|
18533
18528
|
{
|
|
18534
18529
|
ref: imgRef,
|
|
18535
18530
|
className: "image-page",
|
|
18536
|
-
style: imgStyle
|
|
18531
|
+
style: imgStyle,
|
|
18537
18532
|
"data-page-index": props.index,
|
|
18538
18533
|
children: [
|
|
18539
18534
|
/* @__PURE__ */ u(
|
|
@@ -20290,7 +20285,13 @@ class FilePreviewShellController {
|
|
|
20290
20285
|
this.destroyComponent();
|
|
20291
20286
|
this.container = document.querySelector(this.options.selector);
|
|
20292
20287
|
if (this.container)
|
|
20293
|
-
G$1(
|
|
20288
|
+
G$1(
|
|
20289
|
+
_$2(FilePreviewShell, {
|
|
20290
|
+
key: JSON.stringify(this.state.value),
|
|
20291
|
+
controller: this
|
|
20292
|
+
}),
|
|
20293
|
+
this.container
|
|
20294
|
+
);
|
|
20294
20295
|
}
|
|
20295
20296
|
/**
|
|
20296
20297
|
* 销毁组件实例
|